package com.moli.iov.admin.web.controller;

import com.moli.iov.admin.model.vo.req.VehicleBaseAuthReqVo;
import com.moli.iov.admin.service.IBaseCityService;
import com.moli.iov.admin.service.IVehicleBaseAuthService;
import com.moli.iov.base.model.dto.req.VehicleBaseAuthReqDto;
import com.moli.iov.rest.RestResponse;
import com.moli.iov.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * The type Vehicle base auth controller.
 *
 * @author wanghualin
 * @date 2020 -02-27 10:01:37
 */
@Slf4j
@RequestMapping("/monitor")
@RestController
public class VehicleBaseAuthController extends BaseController {
    @Autowired
    private IVehicleBaseAuthService authService;

    /*
     *   车辆授权
     *  VehicleStatusDto
     * @param vin
     * @return
     * @throws Exception*/
    @PostMapping("/vehicleBaseAuth/update")
    public RestResponse updateVehicleBaseAuth(
            @RequestBody VehicleBaseAuthReqVo vo) {
        assembleUserInfo(vo);
        VehicleBaseAuthReqDto dto = new VehicleBaseAuthReqDto();
        CommonUtils.copyProperties(vo, dto);
        return authService.updateVehicleBaseAuth(dto);
    }
}
